<svelte:head>
  <title>{title}</title>
</svelte:head>
<script>
  import { store } from '../_store/store.js'
  import { formatIntl } from '../_utils/formatIntl.js'

  export default {
    data: () => ({
      settingsPage: false
    }),
    store: () => store,
    computed: {
      showInstanceName: ({ $isUserLoggedIn, settingsPage, $currentInstance }) => (
        !!($isUserLoggedIn && !settingsPage && $currentInstance)
      ),
      title: ({ showInstanceName, $currentInstance, $hasNotifications, $numberOfNotifications, name }) => {
        return formatIntl('intl.pageTitle', {
          showInstanceName,
          instanceName: $currentInstance,
          hasNotifications: $hasNotifications,
          count: $numberOfNotifications,
          name
        })
      }
    }
  }
</script>
